From 8dece0e940f52974114782ff25e8b95902a1b374 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 25 Mar 2019 20:26:34 -0400 Subject: [PATCH] gdk: Stop using gdk_device_get_position We should always use the double variant of this api. --- gdk/win32/gdkdrag-win32.c | 7 ++++--- gdk/x11/gdkdrag-x11.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c index 6b9d115419..5583ac9421 100644 --- a/gdk/win32/gdkdrag-win32.c +++ b/gdk/win32/gdkdrag-win32.c @@ -1717,6 +1717,7 @@ _gdk_win32_surface_drag_begin (GdkSurface *surface, GdkDrag *drag; GdkWin32Drag *drag_win32; GdkWin32Clipdrop *clipdrop = _gdk_win32_clipdrop_get (); + double px, py; int x_root, y_root; g_return_val_if_fail (surface != NULL, NULL); @@ -1731,9 +1732,9 @@ _gdk_win32_surface_drag_begin (GdkSurface *surface, GDK_NOTE (DND, g_print ("_gdk_win32_surface_drag_begin\n")); - gdk_device_get_position (device, &x_root, &y_root); - x_root += dx; - y_root += dy; + gdk_device_get_position_double (device, &px, &px); + x_root = round (px) + dx; + y_root = round (py) + dy; drag_win32->start_x = x_root; drag_win32->start_y = y_root; diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index db2abcdc5c..4305bdaf13 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -2077,6 +2077,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface, GdkX11Drag *x11_drag; GdkDrag *drag; GdkDisplay *display; + double px, py; int x_root, y_root; Atom xselection; GdkSurface *ipc_surface; @@ -2097,9 +2098,9 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface, precache_target_list (drag); - gdk_device_get_position (device, &x_root, &y_root); - x_root += dx; - y_root += dy; + gdk_device_get_position_double (device, &px, &py); + x_root = round (px) + dx; + y_root = round (py) + dy; x11_drag->start_x = x_root; x11_drag->start_y = y_root; -- 2.30.2